<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="bean.dal.*,bean.entity.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加包裹类型</title>
	<link rel="stylesheet" type="text/css" href="css/register.css">
	<link rel="stylesheet" type="text/css" href="css/top.css">
	<link rel="stylesheet" type="text/css" href="css/iconfont.css">
	<script type="text/javascript" >
		function check(){
			var typeid=document.getElementById('typeid').value;
			var typename=document.getElementById('typename').value;
			var introduce=document.getElementById('introduce').value;
			var price=document.getElementById('price').value;
			if(typeid==""||typeid==null){
				window.alert("编号不能为空！");
				document.add.typeid.focus();
				return false;
			}
			if(typename==""||typename==null){
				window.alert("名称不能为空！");
				document.add.typename.focus();
				return false;
			}
			if(introduce==""||introduce==null){
				window.alert("介绍不能为空！");
				document.add.introduce.focus();
				return false;
			}
			if(price==""||price==null){
				window.alert("价格不能为空！");
				document.add.price.focus();
				return false;
			}
			return true;
		}
	</script>

  </head>
  
  <body>
	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
	%>
    <form id="bigBox" method="POST" action="/express/servlet/Type?modth=add" name="add" onsubmit="return check()">
        <h1>添加包裹类型</h1>
        <font color="red">
            <span id="message">
                <%if(msg==null){msg="";} %>
                <%=msg %>
            </span>
       </font>
        <!-- 添加包裹类型容器 -->
        <div class="inputBox">
            <!-- 包裹编号 -->
            <div class="inputText"> 
                <span>
                    <i class="iconfont icon-phone"></i>
                    编号:
                </span>
                <input type="text" id="typeid" name="typeid" placeholder="TypeID" >
            </div>
            <!-- 包裹名称 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-user"></i>   
                    名称:   
                </span>
                <input type="text" id="typename" name="typename" placeholder="Typename" >
            </div>
            <!-- 包裹详情 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-xiangqing"></i>
                    详情:
                </span>
                <textarea id="introduce" name="introduce" placeholder="Introduction"></textarea>
            </div>
            <!-- 包裹价格 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-jiage"></i>
                    价格:
                </span>
                <input type="text" id="price" name="price" placeholder="Price"  >
            </div>
            <!-- 添加按钮 -->
            <input type="submit" class="inputButton" value="添加">
            <!-- 返回按钮 -->
            <a href="admin/type.jsp">
                <input type="button" class="inputButton" value="返回">
            </a>
        </div>
    </form>
  </body>
</html>
